import Vue from 'vue'
import Router from 'vue-router'
import Mian from '@/components/mian/index'
Vue.use(Router)
export default new Router({
  mode: 'history',
  scrollBehavior: () => ({
    y: 0
  }),
  routes: [],
})
export const asyncRouterMap = [
  // 用能分析
  {
    path: '/analysis',
    name: 'analysis',
    redirect: '/analysis/dayEnergy',
    component: Mian,
    meta: {
      title: '用能分析',
      icon: 'iconfont icon-fenxi'
    },
    children: [{
      path: 'dayEnergy',
      name: 'dayEnergy',
      component: () =>
        import('@/views/analysis/dayEnergy/index.vue'),
      meta: {
        title: '日能源看板',
      }
    }, {
      path: 'monthEnergy',
      name: 'monthEnergy',
      redirect: '/analysis/monthEnergy/energyConservation',
      component: () =>
        import('@/views/analysis/monthEnergy/index.vue'),
      meta: {
        title: '月能源看板',
        no_router: true,
        router_path: '/analysis/monthEnergy'
      },
      children: [{
          path: 'energyConservation',
          name: 'energyConservation',
          component: () =>
            import('@/views/analysis/monthEnergy/energyConservation.vue'),
          meta: {
            title: '节能减排',
            no_router: true,
            router_path: '/analysis/monthEnergy'
          },

        },
        {
          path: 'operationMonitoring',
          name: 'operationMonitoring',
          component: () =>
            import('@/views/analysis/monthEnergy/operationMonitoring.vue'),
          meta: {
            title: '运行监视',
            no_router: true,
            router_path: '/analysis/monthEnergy'
          },
        }
      ]
    }, {
      path: 'loadDetails',
      name: 'loadDetails',
      component: () =>
        import('@/views/analysis/loadDetails/index.vue'),
      meta: {
        title: '负荷详情',
      }
    }]
  },
  // 用能优化
  {
    path: '/optimize',
    name: 'optimize',
    redirect: '/optimize/cost',
    component: Mian,
    meta: {
      title: '用能优化',
      icon: 'iconfont icon-fenxi1'
    },
    children: [{
        path: 'cost',
        name: 'cost',
        component: () =>
          import('@/views/optimize/cost/index.vue'),
        meta: {
          title: '用电成本分析',
        }
      },
      {
        path: 'demandQuery',
        name: 'demandQuery',
        component: () =>
          import('@/views/optimize/demandQuery/index.vue'),
        meta: {
          title: '需量查询',
        }
      }, {
        path: 'productUnitAnalysis',
        name: 'productUnitAnalysis',
        component: () =>
          import('@/views/optimize/productUnitAnalysis/index.vue'),
        meta: {
          title: '产品单耗分析',
        }
      }, {
        path: 'comparative',
        name: 'comparative',
        component: () =>
          import('@/views/optimize/comparative/index.vue'),
        meta: {
          title: '用能对比分析',
        }
      }
    ]
  },
  // 用能安全
  {
    path: '/security',
    name: 'security',
    redirect: '/security/qualityEnergy',
    component: Mian,
    meta: {
      title: '用能安全',
      icon: 'iconfont icon-anquan1'
    },
    children: [{
      path: 'qualityEnergy',
      name: 'qualityEnergy',
      component: () =>
        import('@/views/security/qualityEnergy/index.vue'),
      meta: {
        title: '用能质量',
      }
    }, {
      path: 'abnormalInformManagement',
      name: 'abnormalInformManagement',
      component: () =>
        import('@/views/security/abnormalInformManagement/index.vue'),
      meta: {
        title: '异常告知管理'
      }
    }, {
      path: 'monitoringEndWarning',
      name: 'monitoringEndWarning',
      component: () =>
        import('@/views/security/monitoringEndWarning/index.vue'),
      meta: {
        title: '负载率监视及预警'
      }
    }]
  },
  // 账单与报表
  {
    path: '/billAndStatements',
    name: 'billAndStatements',
    redirect: 'billAndStatements/electricity/enterprise',
    component: Mian,
    meta: {
      title: '账单及报表',
      icon: 'iconfont icon-zhangdan-copy'

    },
    children: [{
        path: 'electricity',
        name: 'electricity',
        component: () =>
          import('@/views/billAndStatements/electricity/Electricity.vue'),
        redirect: 'electricity/enterprise',
        meta: {
          title: '用电账单',
        },
        children: [{
          path: 'enterprise',
          name: 'enterprise',
          component: () =>
            import('@/views/billAndStatements/electricity/enterprise.vue'),
          meta: {
            title: '用电账单',
            no_router: true,
            router_path: '/billAndStatements/electricity'
          },
        }, {
          path: 'workshop',
          name: 'workshop',
          component: () =>
            import('@/views/billAndStatements/electricity/workshop.vue'),
          meta: {
            title: '用电账单',
            no_router: true,
            router_path: '/billAndStatements/electricity'
          },
        }]
      },
      {
        path: 'steam',
        name: 'steam',
        component: () =>
          import('@/views/billAndStatements/steam/Steam.vue'),
        redirect: 'steam/enterprise_steam',
        meta: {
          title: '用汽账单',
        },
        children: [{
          path: 'enterprise_steam',
          name: 'enterprise_steam',
          component: () =>
            import('@/views/billAndStatements/steam/enterprise.vue'),
          meta: {
            title: '用汽账单',
            no_router: true,
            router_path: '/billAndStatements/steam'
          },
        }, {
          path: 'workshop_steam',
          name: 'workshop_steam',
          component: () =>
            import('@/views/billAndStatements/steam/workshop.vue'),
          meta: {
            title: '用汽账单',
            no_router: true,
            router_path: '/billAndStatements/steam'
          },
        }]
      },
      {
        path: 'energyReport',
        name: 'energyReport',
        component: () =>
          import('@/views/billAndStatements/energyReport/index.vue'),
        meta: {
          title: '整点用能量报表',
        },
      },
      {
        path: 'energyProcurement',
        name: 'energyProcurement',
        component: () =>
          import('@/views/billAndStatements/energyProcurement/index.vue'),
        meta: {
          title: '能源采购管理',
        },
      },
    ]
  },
  // 生产管理
  {
    path: '/productionManagement',
    name: 'productionManagement',
    redirect: '/productionManagement/productionDataManagement',
    component: Mian,
    meta: {
      title: '生产管理',
      icon: 'iconfont icon-guanli'
    },
    children: [{
        path: 'productionPlan',
        name: 'productionPlan',
        component: () =>
          import('@/views/productionManagement/productionPlan/index.vue'),
        meta: {
          title: '生产计划',
          disabled: true
        }
      },
      {
        path: 'productionDataManagement',
        name: 'productionDataManagement',
        component: () =>
          import('@/views/productionManagement/productionDataManagement/index.vue'),
        meta: {
          title: '生产数据管理',
        }
      }, {
        path: 'ProductDataStatistics',
        name: 'ProductDataStatistics',
        component: () =>
          import('@/views/productionManagement/ProductDataStatistics/index.vue'),
        meta: {
          title: '产品数据统计',
        }
      }
    ]
  },
  // 系统管理
  {
    path: '/systemManagement',
    name: 'systemManagement',
    redirect: '/systemManagement/accountingUnit',
    component: Mian,
    meta: {
      title: '系统管理',
      icon: 'iconfont icon-ziyuan'
    },
    children: [{
        path: 'accountingUnit',
        name: 'accountingUnit',
        component: () =>
          import('@/views/systemManagement/accountingUnit/index.vue'),
        meta: {
          title: '核算单元管理',
        }
      },
      {
        path: 'energyInformation',
        name: 'energyInformation',
        redirect: '/systemManagement/energyInformation/list/D1',
        component: () =>
          import('@/views/systemManagement/energyInformation/index.vue'),
        meta: {
          title: '能源信息管理',
        },
        children: [{
          path: 'list',
          name: 'list',
          component: () =>
            import('@/views/systemManagement/energyInformation/list.vue'),
          meta: {
            title: '能源信息管理',
          },
          children: [{
              path: 'D1',
              name: 'D1',
              component: () =>
                import('@/views/systemManagement/energyInformation/D1.vue'),
              meta: {
                title: '能源信息管理',
              },
            }, {
              path: 'D2',
              name: 'D2',
              component: () =>
                import('@/views/systemManagement/energyInformation/D2.vue'),
              meta: {
                title: '能源信息管理',
              },
            }, {
              path: 'D3',
              name: 'D3',
              component: () =>
                import('@/views/systemManagement/energyInformation/D3.vue'),
              meta: {
                title: '能源信息管理',
              },
            },
            {
              path: 'ZQ1',
              name: 'ZQ1',
              component: () =>
                import('@/views/systemManagement/energyInformation/ZQ1.vue'),
              meta: {
                title: '能源信息管理',
              },
            },
            {
              path: 'ZQ2',
              name: 'ZQ2',
              component: () =>
                import('@/views/systemManagement/energyInformation/ZQ2.vue'),
              meta: {
                title: '能源信息管理',
              },
            },
            {
              path: 'ZQ3',
              name: 'ZQ3',
              component: () =>
                import('@/views/systemManagement/energyInformation/ZQ3.vue'),
              meta: {
                title: '能源信息管理',
              },
            }
          ]
        }, {
          path: 'add',
          name: 'add',
          component: () =>
            import('@/views/systemManagement/energyInformation/add.vue'),
          meta: {
            title: '能源信息管理',
          },
        }]
      }
      // {
      //   path: 'productInformation',
      //   name: 'productInformation',
      //   component: () =>
      //     import('@/views/systemManagement/productInformation/index.vue'),
      //   meta: {
      //     title: '产品信息管理',
      //   }
      // }
    ]
  },
]